/**
 * 分类 相关api
 */
import request from './index';

/**
 * 获取分类列表
 * @param {*} data 
 * @returns 
 */
export const fetchList = (data) => {
    return request({
        method: 'get',
        url: "/movies/category/list",
        params: data
   })
}

/**
 * 创建分类
 * @param {*} data 
 * @returns 
 */
export const createCategory = (data) => {
    return request({
        method: 'put', 
        url: '/movies/category/add',
        data
    })
}

/**
 * 更新分类
 * @param {*} data 
 * @returns 
 */
export const updateCategory = (data) => {
    return request({
        method: 'post', 
        url: '/movies/category/update',
        data
    })
}



/**
 * 根据classId  删除分类
 * @param {*} data 
 * @returns 
 */
export const deleteCategory = (data) => {
    return request({
        method: 'delete', 
        url: '/movies/category/delete/'+ data.classId,
        data
    })
}